package com.orange.controller;

import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.orange.handler.AuthSchoolService;
import com.orange.handler.AuthTeacherDataService;
import com.orange.modules.bean.SessionUser;
import com.orange.modules.entity.school.AuthSchool;
import com.orange.modules.entity.school_data.AuthTeacherData;
import com.orange.util.ReturnCode;

@Controller
@RequestMapping("/teacherData")
public class AuthTeacherDataController extends BaseController{

	private static final Logger log = Logger.getLogger(AuthTeacherDataController.class);
	
	@Autowired
	private AuthTeacherDataService authTeacherDataService;
	
	@Autowired
	private AuthSchoolService authSchoolService;
	
	/**
	 * 新增教师信息
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/insertTeacherData" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.POST)
	@ResponseBody
	public ResponseEntity<String> insertTeacherData(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		try {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String fulltimeTeacherNum = map.get("fulltimeTeacherNum"); 
			String schoolSeriesNum = map.get("schoolSeriesNum");
			String schoolPrivatdozentNum = map.get("schoolPrivatdozentNum");
			String professionalFulltimeTeacherNum = map.get("professionalFulltimeTeacherNum");
			String professionalSeriesNum = map.get("professionalSeriesNum");
			String professionalPrivatdozentNum = map.get("professionalPrivatdozentNum");
			String higherEducationFulltimeTeacherNum = map.get("higherEducationFulltimeTeacherNum");
			String doctoralTeachersNum = map.get("doctoralTeachersNum");
			String masterTeachersNum = map.get("masterTeachersNum");
			String readingDoctoralTeachersNum = map.get("readingDoctoralTeachersNum");
			String readingMasterTeachersNum = map.get("readingMasterTeachersNum");
			String masterRatio = map.get("masterRatio");
			String highProfessionalEducationFulltimeTeacherNum = map.get("highProfessionalEducationFulltimeTeacherNum");
			String doctoralDegreeNum = map.get("doctoralDegreeNum");
			String readingDoctoralNum = map.get("readingDoctoralNum");
			String masterDegreeNum = map.get("masterDegreeNum");
			String readingMasterNum = map.get("readingMasterNum");
			String seniorFulltimeTeacherNum = map.get("seniorFulltimeTeacherNum");
			String schoolProfessorNum = map.get("schoolProfessorNum");
			String schoolAssociateProfessorNum = map.get("schoolAssociateProfessorNum");
			String professionalHigherFulltimeTeacherNum = map.get("professionalHigherFulltimeTeacherNum");
			String professionalProfessorNum = map.get("professionalProfessorNum");
			String professionalAssociateProfessorNum = map.get("professionalAssociateProfessorNum");
			String professionalLecturerNum = map.get("professionalLecturerNum");
			String oneyearKindergartenTeachersNum = map.get("oneyearKindergartenTeachersNum");
			String noyearKindergartenTeachersNum = map.get("noyearKindergartenTeachersNum");
			String excellentTeachersNum = map.get("excellentTeachersNum");
			String sid = map.get("sid");
			String logintype = map.get("logintype");
			String status =map.get("status");
			if(fulltimeTeacherNum==null || StringUtils.isBlank(fulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数不能为空");
			if(schoolSeriesNum==null || StringUtils.isBlank(schoolSeriesNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数(在编教师数)不能为空");
			if(schoolPrivatdozentNum==null || StringUtils.isBlank(schoolPrivatdozentNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数( 编外教师数)不能为空");
			if(professionalFulltimeTeacherNum==null || StringUtils.isBlank(professionalFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数不能为空");
			if(professionalSeriesNum==null || StringUtils.isBlank(professionalSeriesNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数(在编教师数 )不能为空");
			if(professionalPrivatdozentNum==null || StringUtils.isBlank(professionalPrivatdozentNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数(编外教师数 )不能为空");
			if(higherEducationFulltimeTeacherNum==null || StringUtils.isBlank(higherEducationFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数不能为空");
			if(doctoralTeachersNum==null || StringUtils.isBlank(doctoralTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(博士学位教师数)不能为空");
			if(masterTeachersNum==null || StringUtils.isBlank(masterTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(硕士学位教师数)不能为空");
			if(readingDoctoralTeachersNum==null || StringUtils.isBlank(readingDoctoralTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(在读博士学位教师数)不能为空");
			if(readingMasterTeachersNum==null || StringUtils.isBlank(readingMasterTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(在读硕士学位教师数)不能为空");
			if(masterRatio==null || StringUtils.isBlank(masterRatio))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专任教师中硕士博士的比例不能为空");
			if(highProfessionalEducationFulltimeTeacherNum==null || StringUtils.isBlank(highProfessionalEducationFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数不能为空");
			if(doctoralDegreeNum==null || StringUtils.isBlank(doctoralDegreeNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(拥有博士学位人数)不能为空");
			if(readingDoctoralNum==null || StringUtils.isBlank(readingDoctoralNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(在读博士生人数)不能为空");
			if(masterDegreeNum==null || StringUtils.isBlank(masterDegreeNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(拥有硕士学位人数)不能为空");
			if(readingMasterNum==null || StringUtils.isBlank(readingMasterNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(在读硕士生人数)不能为空");
			if(seniorFulltimeTeacherNum==null || StringUtils.isBlank(seniorFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数不能为空");
			if(schoolProfessorNum==null || StringUtils.isBlank(schoolProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数(教授)不能为空");
			if(schoolAssociateProfessorNum==null || StringUtils.isBlank(schoolAssociateProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数(副教授)不能为空");
			if(professionalHigherFulltimeTeacherNum==null || StringUtils.isBlank(professionalHigherFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数不能为空");
			if(professionalProfessorNum==null || StringUtils.isBlank(professionalProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(教授)不能为空");
			if(professionalAssociateProfessorNum==null || StringUtils.isBlank(professionalAssociateProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(副教授)不能为空");
			if(professionalLecturerNum==null || StringUtils.isBlank(professionalLecturerNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(讲师)不能为空");
			if(oneyearKindergartenTeachersNum==null || StringUtils.isBlank(oneyearKindergartenTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"有一年中小学幼儿园教育经历教师数不能为空");
			if(noyearKindergartenTeachersNum==null || StringUtils.isBlank(noyearKindergartenTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"无中小学幼儿园教育经历教师数不能为空");
			if(excellentTeachersNum==null || StringUtils.isBlank(excellentTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"选聘一线优秀教师为兼职教师数不能为空");
			if(sid==null || StringUtils.isBlank(sid))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"学校ID不能为空");
			if(logintype==null || StringUtils.isBlank(logintype))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专业类型不能为空");
			if(status==null || StringUtils.isBlank(status))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"数据类型不能为空");
						AuthTeacherData atd = new AuthTeacherData();
			atd.setCreatetime(sdf.format(new Date()));
			atd.setDoctoralDegreeNum(doctoralDegreeNum);
			atd.setDoctoralTeachersNum(doctoralTeachersNum);
			atd.setExcellentTeachersNum(excellentTeachersNum);
			atd.setFulltimeTeacherNum(fulltimeTeacherNum);
			atd.setHigherEducationFulltimeTeacherNum(higherEducationFulltimeTeacherNum);
			atd.setHighProfessionalEducationFulltimeTeacherNum(highProfessionalEducationFulltimeTeacherNum);
			atd.setLogintype(logintype);
			atd.setMasterDegreeNum(masterDegreeNum);
			atd.setMasterRatio(masterRatio);
			atd.setMasterTeachersNum(masterTeachersNum);
			atd.setNoyearKindergartenTeachersNum(noyearKindergartenTeachersNum);
			atd.setOneyearKindergartenTeachersNum(oneyearKindergartenTeachersNum);
			atd.setProfessionalAssociateProfessorNum(professionalAssociateProfessorNum);
			atd.setProfessionalFulltimeTeacherNum(professionalFulltimeTeacherNum);
			atd.setProfessionalHigherFulltimeTeacherNum(professionalHigherFulltimeTeacherNum);
			atd.setProfessionalLecturerNum(professionalLecturerNum);
			atd.setProfessionalPrivatdozentNum(professionalPrivatdozentNum);
			atd.setProfessionalProfessorNum(professionalProfessorNum);
			atd.setProfessionalSeriesNum(professionalSeriesNum);
			atd.setReadingDoctoralNum(readingDoctoralNum);
			atd.setReadingDoctoralTeachersNum(readingDoctoralTeachersNum);
			atd.setReadingMasterNum(readingMasterNum);
			atd.setReadingMasterTeachersNum(readingMasterTeachersNum);
			atd.setSchoolAssociateProfessorNum(schoolAssociateProfessorNum);
			atd.setSchoolPrivatdozentNum(schoolPrivatdozentNum);
			atd.setSchoolProfessorNum(schoolProfessorNum);
			atd.setSchoolSeriesNum(schoolSeriesNum);
			atd.setSeniorFulltimeTeacherNum(seniorFulltimeTeacherNum);
			atd.setSid(sid);
			atd.setStatus(status);
			authTeacherDataService.insertTeacherData(atd);
			
			return toResponse(atd,ReturnCode.SUCCESS,"新增成功");
		} catch (Exception e) {
			log.error(e);
			return toResponse(null,ReturnCode.FAIL,"新增失败");
		}
	}
	
	/**
	 * 通过session来
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/queryTeacherDataBySessionSchoolId" ,produces = MediaType.TEXT_HTML_VALUE+";charset=UTF-8", method=RequestMethod.GET)
	@ResponseBody
	public ResponseEntity<String> queryTeacherDataBySessionSchoolId(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		
			String schoolId=(String) request.getSession().getAttribute(SessionUser.SESSION_USER_KEY);
			if(null==schoolId){
				return toResponse(null,ReturnCode.NOLOGIN,"未登录");
			}
			String loginType=(String) request.getSession().getAttribute(SessionUser.SESSION_USER_KEY);
			if(null==loginType || StringUtils.isBlank(loginType))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专业类型不能为空");
			AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(schoolId, loginType);
			if(null==atd){
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"教师不能为空");
			}
			return toResponse(atd,ReturnCode.SUCCESS,"查询成功");
	}
	
	
	/**
	 * 根据当前用户查询教师信息
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/queryTeacherDataBySchoolId" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.POST)
	@ResponseBody
	public ResponseEntity<String> queryTeacherDataBySchoolId(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		String schoolId = map.get("schoolId");
		String loginType = map.get("loginType");
		if(schoolId==null || StringUtils.isBlank(schoolId))
			return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"学校ID不能为空");
		if(loginType==null || StringUtils.isBlank(loginType))
			return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专业类型不能为空");
		AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(schoolId, loginType);
		return toResponse(atd,ReturnCode.SUCCESS,"查询成功");
	}
	
	/**
	 * 修改教师表
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/updateTeacherData" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.POST)
	@ResponseBody
	public ResponseEntity<String> updateTeacherData(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		String schoolId = map.get("sid");
		String loginType = map.get("logintype");
		if(schoolId==null || StringUtils.isBlank(schoolId))
			return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"学校ID不能为空");
		if(loginType==null || StringUtils.isBlank(loginType))
			return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专业类型不能为空");
		try {
			AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(schoolId, loginType);
			if(atd!=null){
				String fulltimeTeacherNum = map.get("fulltimeTeacherNum"); 
				String schoolSeriesNum = map.get("schoolSeriesNum");
				String schoolPrivatdozentNum = map.get("schoolPrivatdozentNum");
				String professionalFulltimeTeacherNum = map.get("professionalFulltimeTeacherNum");
				String professionalSeriesNum = map.get("professionalSeriesNum");
				String professionalPrivatdozentNum = map.get("professionalPrivatdozentNum");
				String higherEducationFulltimeTeacherNum = map.get("higherEducationFulltimeTeacherNum");
				String doctoralTeachersNum = map.get("doctoralTeachersNum");
				String masterTeachersNum = map.get("masterTeachersNum");
				String readingDoctoralTeachersNum = map.get("readingDoctoralTeachersNum");
				String readingMasterTeachersNum = map.get("readingMasterTeachersNum");
				String masterRatio = map.get("masterRatio");
				String highProfessionalEducationFulltimeTeacherNum = map.get("highProfessionalEducationFulltimeTeacherNum");
				String doctoralDegreeNum = map.get("doctoralDegreeNum");
				String readingDoctoralNum = map.get("readingDoctoralNum");
				String masterDegreeNum = map.get("masterDegreeNum");
				String readingMasterNum = map.get("readingMasterNum");
				String seniorFulltimeTeacherNum = map.get("seniorFulltimeTeacherNum");
				String schoolProfessorNum = map.get("schoolProfessorNum");
				String schoolAssociateProfessorNum = map.get("schoolAssociateProfessorNum");
				String professionalHigherFulltimeTeacherNum = map.get("professionalHigherFulltimeTeacherNum");
				String professionalProfessorNum = map.get("professionalProfessorNum");
				String professionalAssociateProfessorNum = map.get("professionalAssociateProfessorNum");
				String professionalLecturerNum = map.get("professionalLecturerNum");
				String oneyearKindergartenTeachersNum = map.get("oneyearKindergartenTeachersNum");
				String noyearKindergartenTeachersNum = map.get("noyearKindergartenTeachersNum");
				String excellentTeachersNum = map.get("excellentTeachersNum");
				String status =map.get("status");
				if(fulltimeTeacherNum!=null && StringUtils.isNotBlank(fulltimeTeacherNum))
					atd.setFulltimeTeacherNum(fulltimeTeacherNum);
				if(schoolSeriesNum!=null && StringUtils.isNotBlank(schoolSeriesNum))
					atd.setSchoolSeriesNum(schoolSeriesNum);
				if(schoolPrivatdozentNum!=null && StringUtils.isNotBlank(schoolPrivatdozentNum))
					atd.setSchoolPrivatdozentNum(schoolPrivatdozentNum);
				if(professionalFulltimeTeacherNum!=null && StringUtils.isNotBlank(professionalFulltimeTeacherNum))
					atd.setProfessionalFulltimeTeacherNum(professionalFulltimeTeacherNum);
				if(professionalSeriesNum!=null && StringUtils.isNotBlank(professionalSeriesNum))
					atd.setProfessionalSeriesNum(professionalSeriesNum);
				if(professionalPrivatdozentNum!=null && StringUtils.isNotBlank(professionalPrivatdozentNum))
					atd.setProfessionalPrivatdozentNum(professionalPrivatdozentNum);
				if(higherEducationFulltimeTeacherNum!=null && StringUtils.isNotBlank(higherEducationFulltimeTeacherNum))
					atd.setHigherEducationFulltimeTeacherNum(higherEducationFulltimeTeacherNum);
				if(doctoralTeachersNum!=null && StringUtils.isNotBlank(doctoralTeachersNum))
					atd.setDoctoralTeachersNum(doctoralTeachersNum);
				if(masterTeachersNum!=null && StringUtils.isNotBlank(masterTeachersNum))
					atd.setMasterTeachersNum(masterTeachersNum);
				if(readingDoctoralTeachersNum!=null && StringUtils.isNotBlank(readingDoctoralTeachersNum))
					atd.setReadingDoctoralTeachersNum(readingDoctoralTeachersNum);
				if(readingMasterTeachersNum!=null && StringUtils.isNotBlank(readingMasterTeachersNum))
					atd.setReadingMasterTeachersNum(readingMasterTeachersNum);
				if(masterRatio!=null && StringUtils.isNotBlank(masterRatio))
					atd.setMasterRatio(masterRatio);
				if(highProfessionalEducationFulltimeTeacherNum!=null && StringUtils.isNotBlank(highProfessionalEducationFulltimeTeacherNum))
					atd.setHighProfessionalEducationFulltimeTeacherNum(highProfessionalEducationFulltimeTeacherNum);
				if(doctoralDegreeNum!=null && StringUtils.isNotBlank(doctoralDegreeNum))
					atd.setDoctoralDegreeNum(doctoralDegreeNum);
				if(readingDoctoralNum!=null && StringUtils.isNotBlank(readingDoctoralNum))
					atd.setReadingDoctoralNum(readingDoctoralNum);
				if(masterDegreeNum!=null && StringUtils.isNotBlank(masterDegreeNum))
					atd.setMasterDegreeNum(masterDegreeNum);
				if(readingMasterNum!=null && StringUtils.isNotBlank(readingMasterNum))
					atd.setReadingMasterNum(readingMasterNum);
				if(seniorFulltimeTeacherNum!=null && StringUtils.isNotBlank(seniorFulltimeTeacherNum))
					atd.setSeniorFulltimeTeacherNum(seniorFulltimeTeacherNum);
				if(schoolProfessorNum!=null && StringUtils.isNotBlank(schoolProfessorNum))
					atd.setSchoolProfessorNum(schoolProfessorNum);
				if(schoolAssociateProfessorNum!=null && StringUtils.isNotBlank(schoolAssociateProfessorNum))
					atd.setSchoolAssociateProfessorNum(schoolAssociateProfessorNum);
				if(professionalHigherFulltimeTeacherNum!=null && StringUtils.isNotBlank(professionalHigherFulltimeTeacherNum))
					atd.setProfessionalHigherFulltimeTeacherNum(professionalHigherFulltimeTeacherNum);
				if(professionalProfessorNum!=null && StringUtils.isNotBlank(professionalProfessorNum))
					atd.setProfessionalProfessorNum(professionalProfessorNum);
				if(professionalAssociateProfessorNum!=null && StringUtils.isNotBlank(professionalAssociateProfessorNum))
					atd.setProfessionalAssociateProfessorNum(professionalAssociateProfessorNum);
				if(professionalLecturerNum!=null && StringUtils.isNotBlank(professionalLecturerNum))
					atd.setProfessionalLecturerNum(professionalLecturerNum);
				if(oneyearKindergartenTeachersNum!=null && StringUtils.isNotBlank(oneyearKindergartenTeachersNum))
					atd.setOneyearKindergartenTeachersNum(oneyearKindergartenTeachersNum);
				if(noyearKindergartenTeachersNum!=null && StringUtils.isNotBlank(noyearKindergartenTeachersNum))
					atd.setNoyearKindergartenTeachersNum(noyearKindergartenTeachersNum);
				if(excellentTeachersNum!=null && StringUtils.isNotBlank(excellentTeachersNum))
					atd.setExcellentTeachersNum(excellentTeachersNum);
				if(status!=null && StringUtils.isNotBlank(status))
					atd.setStatus(status);
				authTeacherDataService.insertTeacherData(atd);
			}
			return toResponse(atd,ReturnCode.SUCCESS,"修改成功");
		} catch (Exception e) {
			// TODO: handle exception
			return toResponse(null,ReturnCode.FAIL,"修改失败");
		}
	}
	
	/**************************************************************************************************************************/
	/**
	 * 新增教师信息
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/insertTeacherData1" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.POST)
	@ResponseBody
	public ResponseEntity<String> insertTeacherData1(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		try {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String sid = (String) request.getSession().getAttribute(SessionUser.SESSION_USER_KEY);
			if(null==sid){
				return toResponse(null,ReturnCode.NOLOGIN,"未登陆");
			}
			String subject = (String) request.getSession().getAttribute(SessionUser.SESSION_STATUS);//学科
			
			String fulltimeTeacherNum = map.get("fulltimeTeacherNum"); 
			String schoolSeriesNum = map.get("schoolSeriesNum");
			String schoolPrivatdozentNum = map.get("schoolPrivatdozentNum");
			String professionalFulltimeTeacherNum = map.get("professionalFulltimeTeacherNum");
			String professionalSeriesNum = map.get("professionalSeriesNum");
			String professionalPrivatdozentNum = map.get("professionalPrivatdozentNum");
			String higherEducationFulltimeTeacherNum = map.get("higherEducationFulltimeTeacherNum");
			String doctoralTeachersNum = map.get("doctoralTeachersNum");
			String masterTeachersNum = map.get("masterTeachersNum");
			String readingDoctoralTeachersNum = map.get("readingDoctoralTeachersNum");
			String readingMasterTeachersNum = map.get("readingMasterTeachersNum");
			String masterRatio = map.get("masterRatio");
			String highProfessionalEducationFulltimeTeacherNum = map.get("highProfessionalEducationFulltimeTeacherNum");
			String doctoralDegreeNum = map.get("doctoralDegreeNum");
			String readingDoctoralNum = map.get("readingDoctoralNum");
			String masterDegreeNum = map.get("masterDegreeNum");
			String readingMasterNum = map.get("readingMasterNum");
			String seniorFulltimeTeacherNum = map.get("seniorFulltimeTeacherNum");
			String schoolProfessorNum = map.get("schoolProfessorNum");
			String schoolAssociateProfessorNum = map.get("schoolAssociateProfessorNum");
			String professionalHigherFulltimeTeacherNum = map.get("professionalHigherFulltimeTeacherNum");
			String professionalProfessorNum = map.get("professionalProfessorNum");
			String professionalAssociateProfessorNum = map.get("professionalAssociateProfessorNum");
			String professionalLecturerNum = map.get("professionalLecturerNum");
			String oneyearKindergartenTeachersNum = map.get("oneyearKindergartenTeachersNum");
			String noyearKindergartenTeachersNum = map.get("noyearKindergartenTeachersNum");
			String excellentTeachersNum = map.get("excellentTeachersNum");
			String status ="0";
			String remark1 = map.get("remark1");
			String remark2 = map.get("remark2");
			String remark3 = map.get("remark3");
			String remark4 = map.get("remark4");
			String remark5 = map.get("remark5");
			String remark6 = map.get("remark6");
			String remark7 = map.get("remark7");
			String remark8 = map.get("remark8");
			String remark9 = map.get("remark9");
			String remark10 = map.get("remark10");
			String remark11 = map.get("remark11");
			String remark12 = map.get("remark12");
			String remark13 = map.get("remark13");
			String remark14 = map.get("remark14");
			String remark15 = map.get("remark15");
			String remark16 = map.get("remark16");
			String remark17 = map.get("remark17");
			String remark18 = map.get("remark18");
			String remark19 = map.get("remark19");
			String remark20 = map.get("remark20");
			String remark21 = map.get("remark21");
			String remark22 = map.get("remark22");
			String remark23 = map.get("remark23");
			String remark24 = map.get("remark24");
			String remark25 = map.get("remark25");
			String remark26 = map.get("remark26");
			String remark27 = map.get("remark27");
			if(fulltimeTeacherNum==null || StringUtils.isBlank(fulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数不能为空");
			if(schoolSeriesNum==null || StringUtils.isBlank(schoolSeriesNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数(在编教师数)不能为空");
			if(schoolPrivatdozentNum==null || StringUtils.isBlank(schoolPrivatdozentNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师数( 编外教师数)不能为空");
			if(professionalFulltimeTeacherNum==null || StringUtils.isBlank(professionalFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数不能为空");
			if(professionalSeriesNum==null || StringUtils.isBlank(professionalSeriesNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数(在编教师数 )不能为空");
			if(professionalPrivatdozentNum==null || StringUtils.isBlank(professionalPrivatdozentNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师数(编外教师数 )不能为空");
			if(higherEducationFulltimeTeacherNum==null || StringUtils.isBlank(higherEducationFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数不能为空");
			if(doctoralTeachersNum==null || StringUtils.isBlank(doctoralTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(博士学位教师数)不能为空");
			if(masterTeachersNum==null || StringUtils.isBlank(masterTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(硕士学位教师数)不能为空");
			if(readingDoctoralTeachersNum==null || StringUtils.isBlank(readingDoctoralTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(在读博士学位教师数)不能为空");
			if(readingMasterTeachersNum==null || StringUtils.isBlank(readingMasterTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）高学历专任教师数(在读硕士学位教师数)不能为空");
			if(masterRatio==null || StringUtils.isBlank(masterRatio))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"专任教师中硕士博士的比例不能为空");
			if(highProfessionalEducationFulltimeTeacherNum==null || StringUtils.isBlank(highProfessionalEducationFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数不能为空");
			if(doctoralDegreeNum==null || StringUtils.isBlank(doctoralDegreeNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(拥有博士学位人数)不能为空");
			if(readingDoctoralNum==null || StringUtils.isBlank(readingDoctoralNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(在读博士生人数)不能为空");
			if(masterDegreeNum==null || StringUtils.isBlank(masterDegreeNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(拥有硕士学位人数)不能为空");
			if(readingMasterNum==null || StringUtils.isBlank(readingMasterNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业高学历专任教师数(在读硕士生人数)不能为空");
			if(seniorFulltimeTeacherNum==null || StringUtils.isBlank(seniorFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数不能为空");
			if(schoolProfessorNum==null || StringUtils.isBlank(schoolProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数(教授)不能为空");
			if(schoolAssociateProfessorNum==null || StringUtils.isBlank(schoolAssociateProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"全校（院）专任教师中高级职称人数(副教授)不能为空");
			if(professionalHigherFulltimeTeacherNum==null || StringUtils.isBlank(professionalHigherFulltimeTeacherNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数不能为空");
			if(professionalProfessorNum==null || StringUtils.isBlank(professionalProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(教授)不能为空");
			if(professionalAssociateProfessorNum==null || StringUtils.isBlank(professionalAssociateProfessorNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(副教授)不能为空");
			if(professionalLecturerNum==null || StringUtils.isBlank(professionalLecturerNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"本专业专任教师中高级职称人数(讲师)不能为空");
			if(oneyearKindergartenTeachersNum==null || StringUtils.isBlank(oneyearKindergartenTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"有一年中小学幼儿园教育经历教师数不能为空");
			if(noyearKindergartenTeachersNum==null || StringUtils.isBlank(noyearKindergartenTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"无中小学幼儿园教育经历教师数不能为空");
			if(excellentTeachersNum==null || StringUtils.isBlank(excellentTeachersNum))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"选聘一线优秀教师为兼职教师数不能为空");
			if(sid==null || StringUtils.isBlank(sid))
				return toResponse(null,ReturnCode.PARAMETER_NOT_NULL,"学校ID不能为空");
			String remark = remark1+"#"+remark2+"#"+remark3+"#"+remark4+"#"+remark5+"#"+remark6+"#"+remark7+"#"+remark8+"#"+remark9+"#"+remark10+"#"+remark11+"#"+remark12+"#"+remark13+"#"+remark14+"#"
					  + remark15+"#"+remark16+"#"+remark17+"#"+remark18+"#"+remark19+"#"+remark20+"#"+remark21+"#"+remark22+"#"+remark23+"#"+remark24+"#"+remark25+"#"+remark26+"#"+remark27;
			AuthTeacherData atd = new AuthTeacherData();
			atd.setCreatetime(sdf.format(new Date()));
			atd.setDoctoralDegreeNum(doctoralDegreeNum);
			atd.setDoctoralTeachersNum(doctoralTeachersNum);
			atd.setExcellentTeachersNum(excellentTeachersNum);
			atd.setFulltimeTeacherNum(fulltimeTeacherNum);
			atd.setHigherEducationFulltimeTeacherNum(higherEducationFulltimeTeacherNum);
			atd.setHighProfessionalEducationFulltimeTeacherNum(highProfessionalEducationFulltimeTeacherNum);
			atd.setLogintype(subject);
			atd.setMasterDegreeNum(masterDegreeNum);
			atd.setMasterRatio(masterRatio);
			atd.setMasterTeachersNum(masterTeachersNum);
			atd.setNoyearKindergartenTeachersNum(noyearKindergartenTeachersNum);
			atd.setOneyearKindergartenTeachersNum(oneyearKindergartenTeachersNum);
			atd.setProfessionalAssociateProfessorNum(professionalAssociateProfessorNum);
			atd.setProfessionalFulltimeTeacherNum(professionalFulltimeTeacherNum);
			atd.setProfessionalHigherFulltimeTeacherNum(professionalHigherFulltimeTeacherNum);
			atd.setProfessionalLecturerNum(professionalLecturerNum);
			atd.setProfessionalPrivatdozentNum(professionalPrivatdozentNum);
			atd.setProfessionalProfessorNum(professionalProfessorNum);
			atd.setProfessionalSeriesNum(professionalSeriesNum);
			atd.setReadingDoctoralNum(readingDoctoralNum);
			atd.setReadingDoctoralTeachersNum(readingDoctoralTeachersNum);
			atd.setReadingMasterNum(readingMasterNum);
			atd.setReadingMasterTeachersNum(readingMasterTeachersNum);
			atd.setSchoolAssociateProfessorNum(schoolAssociateProfessorNum);
			atd.setSchoolPrivatdozentNum(schoolPrivatdozentNum);
			atd.setSchoolProfessorNum(schoolProfessorNum);
			atd.setSchoolSeriesNum(schoolSeriesNum);
			atd.setSeniorFulltimeTeacherNum(seniorFulltimeTeacherNum);
			atd.setSid(sid);
			atd.setStatus(status);
			atd.setRemark(remark);
			authTeacherDataService.insertTeacherData(atd);
			
			AuthSchool as = authSchoolService.queryAuthSchoolInfoBypid(sid);
			atd.setLogintype(subject);
			//专业类型
			if("1".equals(status)){
				if("1101".equals(subject) ){ //如果是理科
					if(as.getScience().equals("2"))  //如果是登陆过 
						as.setScience("4");
					if(as.getScience().equals("3"))   //如果填写过基础数据状态表
						as.setScience("5");
				}
				if("1102".equals(subject) ){ //如果是文科
					if(as.getLiberalarts().equals("2"))  //如果是登陆过 
						as.setLiberalarts("4");
					if(as.getLiberalarts().equals("3"))   //如果填写过基础数据状态表
						as.setLiberalarts("5");
				}
				if("1103".equals(subject) ){ //如果是整体申报
					if(as.getWholeDeclaration().equals("2"))  //如果是登陆过 
						as.setWholeDeclaration("4");
					if(as.getWholeDeclaration().equals("3"))   //如果填写过基础数据状态表
						as.setWholeDeclaration("5");
				}
			}
			authSchoolService.updateAuthSchoolInfo(as);
			return toResponse(atd,ReturnCode.SUCCESS,"新增成功");
		} catch (Exception e) {
			// TODO: handle exception
			log.error(e);
			return toResponse(null,ReturnCode.FAIL,"新增失败");
		}
	}
	

	
	/**
	 * 根据当前用户查询教师信息
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/queryTeacherDataBySchoolId1" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.GET)
	@ResponseBody
	public ResponseEntity<String> queryTeacherDataBySchoolId1(HttpServletRequest request) throws SQLException{
		String sid = (String) request.getSession().getAttribute(SessionUser.SESSION_USER_KEY);
		if(null==sid){
			return toResponse(null,ReturnCode.NOLOGIN,"未登陆");
		}
		String subject = (String) request.getSession().getAttribute(SessionUser.SESSION_STATUS);//学科
		
		AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(sid, subject);
		return toResponse(atd,ReturnCode.SUCCESS,"查询成功");
	}
	
	/**
	 * 修改教师表
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/updateTeacherData1" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.POST)
	@ResponseBody
	public ResponseEntity<String> updateTeacherData1(HttpServletRequest request,@RequestBody Map<String ,String> map) throws SQLException{
		String sid = (String) request.getSession().getAttribute(SessionUser.SESSION_USER_KEY);
		if(null==sid){
			return toResponse(null,ReturnCode.NOLOGIN,"未登陆");
		}
		String subject = (String) request.getSession().getAttribute(SessionUser.SESSION_STATUS);//学科
		
		try {
			AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(sid, subject);
			if(atd!=null){
				String fulltimeTeacherNum = map.get("fulltimeTeacherNum"); 
				String schoolSeriesNum = map.get("schoolSeriesNum");
				String schoolPrivatdozentNum = map.get("schoolPrivatdozentNum");
				String professionalFulltimeTeacherNum = map.get("professionalFulltimeTeacherNum");
				String professionalSeriesNum = map.get("professionalSeriesNum");
				String professionalPrivatdozentNum = map.get("professionalPrivatdozentNum");
				String higherEducationFulltimeTeacherNum = map.get("higherEducationFulltimeTeacherNum");
				String doctoralTeachersNum = map.get("doctoralTeachersNum");
				String masterTeachersNum = map.get("masterTeachersNum");
				String readingDoctoralTeachersNum = map.get("readingDoctoralTeachersNum");
				String readingMasterTeachersNum = map.get("readingMasterTeachersNum");
				String masterRatio = map.get("masterRatio");
				String highProfessionalEducationFulltimeTeacherNum = map.get("highProfessionalEducationFulltimeTeacherNum");
				String doctoralDegreeNum = map.get("doctoralDegreeNum");
				String readingDoctoralNum = map.get("readingDoctoralNum");
				String masterDegreeNum = map.get("masterDegreeNum");
				String readingMasterNum = map.get("readingMasterNum");
				String seniorFulltimeTeacherNum = map.get("seniorFulltimeTeacherNum");
				String schoolProfessorNum = map.get("schoolProfessorNum");
				String schoolAssociateProfessorNum = map.get("schoolAssociateProfessorNum");
				String professionalHigherFulltimeTeacherNum = map.get("professionalHigherFulltimeTeacherNum");
				String professionalProfessorNum = map.get("professionalProfessorNum");
				String professionalAssociateProfessorNum = map.get("professionalAssociateProfessorNum");
				String professionalLecturerNum = map.get("professionalLecturerNum");
				String oneyearKindergartenTeachersNum = map.get("oneyearKindergartenTeachersNum");
				String noyearKindergartenTeachersNum = map.get("noyearKindergartenTeachersNum");
				String excellentTeachersNum = map.get("excellentTeachersNum");
				String remark1 = map.get("remark1");
				String remark2 = map.get("remark2");
				String remark3 = map.get("remark3");
				String remark4 = map.get("remark4");
				String remark5 = map.get("remark5");
				String remark6 = map.get("remark6");
				String remark7 = map.get("remark7");
				String remark8 = map.get("remark8");
				String remark9 = map.get("remark9");
				String remark10 = map.get("remark10");
				String remark11 = map.get("remark11");
				String remark12 = map.get("remark12");
				String remark13 = map.get("remark13");
				String remark14 = map.get("remark14");
				String remark15 = map.get("remark15");
				String remark16 = map.get("remark16");
				String remark17 = map.get("remark17");
				String remark18 = map.get("remark18");
				String remark19 = map.get("remark19");
				String remark20 = map.get("remark20");
				String remark21 = map.get("remark21");
				String remark22 = map.get("remark22");
				String remark23 = map.get("remark23");
				String remark24 = map.get("remark24");
				String remark25 = map.get("remark25");
				String remark26 = map.get("remark26");
				String remark27 = map.get("remark27");
				
				if(fulltimeTeacherNum!=null && StringUtils.isNotBlank(fulltimeTeacherNum))
					atd.setFulltimeTeacherNum(fulltimeTeacherNum);
				if(schoolSeriesNum!=null && StringUtils.isNotBlank(schoolSeriesNum))
					atd.setSchoolSeriesNum(schoolSeriesNum);
				if(schoolPrivatdozentNum!=null && StringUtils.isNotBlank(schoolPrivatdozentNum))
					atd.setSchoolPrivatdozentNum(schoolPrivatdozentNum);
				if(professionalFulltimeTeacherNum!=null && StringUtils.isNotBlank(professionalFulltimeTeacherNum))
					atd.setProfessionalFulltimeTeacherNum(professionalFulltimeTeacherNum);
				if(professionalSeriesNum!=null && StringUtils.isNotBlank(professionalSeriesNum))
					atd.setProfessionalSeriesNum(professionalSeriesNum);
				if(professionalPrivatdozentNum!=null && StringUtils.isNotBlank(professionalPrivatdozentNum))
					atd.setProfessionalPrivatdozentNum(professionalPrivatdozentNum);
				if(higherEducationFulltimeTeacherNum!=null && StringUtils.isNotBlank(higherEducationFulltimeTeacherNum))
					atd.setHigherEducationFulltimeTeacherNum(higherEducationFulltimeTeacherNum);
				if(doctoralTeachersNum!=null && StringUtils.isNotBlank(doctoralTeachersNum))
					atd.setDoctoralTeachersNum(doctoralTeachersNum);
				if(masterTeachersNum!=null && StringUtils.isNotBlank(masterTeachersNum))
					atd.setMasterTeachersNum(masterTeachersNum);
				if(readingDoctoralTeachersNum!=null && StringUtils.isNotBlank(readingDoctoralTeachersNum))
					atd.setReadingDoctoralTeachersNum(readingDoctoralTeachersNum);
				if(readingMasterTeachersNum!=null && StringUtils.isNotBlank(readingMasterTeachersNum))
					atd.setReadingMasterTeachersNum(readingMasterTeachersNum);
				if(masterRatio!=null && StringUtils.isNotBlank(masterRatio))
					atd.setMasterRatio(masterRatio);
				if(highProfessionalEducationFulltimeTeacherNum!=null && StringUtils.isNotBlank(highProfessionalEducationFulltimeTeacherNum))
					atd.setHighProfessionalEducationFulltimeTeacherNum(highProfessionalEducationFulltimeTeacherNum);
				if(doctoralDegreeNum!=null && StringUtils.isNotBlank(doctoralDegreeNum))
					atd.setDoctoralDegreeNum(doctoralDegreeNum);
				if(readingDoctoralNum!=null && StringUtils.isNotBlank(readingDoctoralNum))
					atd.setReadingDoctoralNum(readingDoctoralNum);
				if(masterDegreeNum!=null && StringUtils.isNotBlank(masterDegreeNum))
					atd.setMasterDegreeNum(masterDegreeNum);
				if(readingMasterNum!=null && StringUtils.isNotBlank(readingMasterNum))
					atd.setReadingMasterNum(readingMasterNum);
				if(seniorFulltimeTeacherNum!=null && StringUtils.isNotBlank(seniorFulltimeTeacherNum))
					atd.setSeniorFulltimeTeacherNum(seniorFulltimeTeacherNum);
				if(schoolProfessorNum!=null && StringUtils.isNotBlank(schoolProfessorNum))
					atd.setSchoolProfessorNum(schoolProfessorNum);
				if(schoolAssociateProfessorNum!=null && StringUtils.isNotBlank(schoolAssociateProfessorNum))
					atd.setSchoolAssociateProfessorNum(schoolAssociateProfessorNum);
				if(professionalHigherFulltimeTeacherNum!=null && StringUtils.isNotBlank(professionalHigherFulltimeTeacherNum))
					atd.setProfessionalHigherFulltimeTeacherNum(professionalHigherFulltimeTeacherNum);
				if(professionalProfessorNum!=null && StringUtils.isNotBlank(professionalProfessorNum))
					atd.setProfessionalProfessorNum(professionalProfessorNum);
				if(professionalAssociateProfessorNum!=null && StringUtils.isNotBlank(professionalAssociateProfessorNum))
					atd.setProfessionalAssociateProfessorNum(professionalAssociateProfessorNum);
				if(professionalLecturerNum!=null && StringUtils.isNotBlank(professionalLecturerNum))
					atd.setProfessionalLecturerNum(professionalLecturerNum);
				if(oneyearKindergartenTeachersNum!=null && StringUtils.isNotBlank(oneyearKindergartenTeachersNum))
					atd.setOneyearKindergartenTeachersNum(oneyearKindergartenTeachersNum);
				if(noyearKindergartenTeachersNum!=null && StringUtils.isNotBlank(noyearKindergartenTeachersNum))
					atd.setNoyearKindergartenTeachersNum(noyearKindergartenTeachersNum);
				if(excellentTeachersNum!=null && StringUtils.isNotBlank(excellentTeachersNum))
					atd.setExcellentTeachersNum(excellentTeachersNum);
				String remark = remark1+"#"+remark2+"#"+remark3+"#"+remark4+"#"+remark5+"#"+remark6+"#"+remark7+"#"+remark8+"#"+remark9+"#"+remark10+"#"+remark11+"#"+remark12+"#"+remark13+"#"+remark14+"#"
						  + remark15+"#"+remark16+"#"+remark17+"#"+remark18+"#"+remark19+"#"+remark20+"#"+remark21+"#"+remark22+"#"+remark23+"#"+remark24+"#"+remark25+"#"+remark26+"#"+remark27;
				atd.setRemark(remark);
				atd.setStatus("1");
				authTeacherDataService.insertTeacherData(atd);
			}
			return toResponse(atd,ReturnCode.SUCCESS,"修改成功");
		} catch (Exception e) {
			// TODO: handle exception
			return toResponse(null,ReturnCode.FAIL,"修改失败");
		}
		
	}
	
	
	/**
	 * 根据当前用户查询教师信息
	 * @param request
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	@RequestMapping(value = "/queryTeacherDataBySchoolId2" ,produces = MediaType.APPLICATION_JSON_VALUE+";charset=UTF-8", method=RequestMethod.GET)
	@ResponseBody
	public ResponseEntity<String> queryTeacherDataBySchoolId2(HttpServletRequest request,@RequestParam String schoolid) throws SQLException{
		try {
			AuthTeacherData atd = authTeacherDataService.queryAuthTeacherDataBySchoolId(schoolid, null);
			return toResponse(atd,ReturnCode.SUCCESS,"查询教师数据成功");
		} catch (Exception e) {
			log.error("查询教师数据失败",e);
			return toResponse(null,ReturnCode.FAIL,"查询教师数据失败");
		}
	}
}


